using System;
using System.Collections.Generic;
using RMH.DataAccess;
using RMH.Entities;

namespace RMH.Services
{
    public class SupportPersonService : BaseRepositoryBackedService<SupportPerson, ISupportPersonRepository>, ISupportPersonService
    {
        public SupportPersonService(ISupportPersonRepository repository) : base(repository)
        {
        }

        public IList<SupportPerson> Search(string firstName, string lastName)
        {
            var searchCriteria = new Dictionary<string, object>();
            if (!String.IsNullOrEmpty(firstName))
                searchCriteria.Add("FirstName", firstName);
            if (!String.IsNullOrEmpty(lastName))
                searchCriteria.Add("LastName", lastName);
            return _repository.FindAll(searchCriteria);
        }

    }
}